package com.edfu.core.util;


import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.edfu.core.contentmgt.jcr.service.api.IContentMgtService;
import com.edfu.core.coursemgt.service.api.ICourseMgtService;
import com.edfu.core.identitymgt.service.api.IIdentityMgtService;
import com.edfu.core.institutemgt.service.api.IInstituteMgtService;

public class EduServiceFactory {
	private static ApplicationContext appContext ;
	static {
		appContext = new ClassPathXmlApplicationContext("applicationContext.xml");
	}
	
	public static ApplicationContext getApplicationContext() {
		return appContext ;
	} 
	
	public static ICourseMgtService getCourseMgtService() {
		return (ICourseMgtService)getApplicationContext().getBean("courseMgtService");
	}
	
	public static IIdentityMgtService getIdentityMgtService() {
		return (IIdentityMgtService)getApplicationContext().getBean("identityMgtService");
	}
	
	public static IContentMgtService getContentMgtService() {
		return (IContentMgtService)getApplicationContext().getBean("contentMgtService");
	}
	
	public static IInstituteMgtService getInstituteMgtService() {
		return (IInstituteMgtService)getApplicationContext().getBean("instituteMgtService");
	}
	
}
